#ifndef __TILE_NODE_HPP__
#define __TILE_NODE_HPP__

#include "Tile.hpp"
#include <vector>

class TileNode : public Tile
{
public:
	TileNode(TileNode* pParentNode = NULL, int iChildNum = 0, Tile newTile = Tile());
	TileNode(unsigned int iWidth, unsigned int iHeight);
	~TileNode();

	TileNode*  getNextNode();
	TileNode*  getNextLeaf();
	TileNode*  getParent();
	TileNode*  getChild(size_t number);

	MVector2D    getDisplacedSamplingPoint(unsigned int iImportance);
	
	unsigned int getDepthLvl();    //returns depth level in tree
	unsigned int getChildNumber(); //returns number of this node in parent's child vector
	bool         isLeaf();         //check if node is leaf
	void         divide();         //divide tile in this node
	void         destroyBranch();  //destroy branch of tree located under this node
	size_t       getChildCount();  //returns number of children this nodes possess

private:
	unsigned int m_iDepthLevel;
	unsigned int m_iChildNumber;
	bool         m_bLeafNode;

	TileNode*              m_pParentNode;
	std::vector<TileNode*> m_childrenNodes;	
};

#endif //__TILE_NODE_HPP__

//EOF
